$(function() {
    var dom = document.getElementById("container2");
    var myChart = echarts.init(dom);
    var app = {};
    option = null;
    option = {
        tooltip: {
            trigger: 'item'
          },
        // legend: {
        //     x : 'center',
        //     y : 'bottom',
        //     itemWidth: 8,
        //     itemHeight: 8,
        //     textStyle:{//图例文字的样式
        //         color:'#fff',
        //         fontSize:12
        //     },
        //     data:['在用','备用','试模','维护','维修','封存','外借','待维护','委外维护']
        // },
        calculable : true,
        label: {
            alignTo: 'edge',
            formatter: '{name|{b}}: {c}',
            minMargin: 5,
            edgeDistance: 10,
            lineHeight: 15,
            rich: {
              time: {
                fontSize: 10,
                color: '#999'
              }
            }
          },
        series : [
            {
                name:'模具状态',
                type:'pie',
                radius : [30, 75],
                center : ['50%', '45%'],
                data:[
                    {value:vm.online.v1, name:'在用',itemStyle:{normal:{color:'rgb(59, 150, 73)'}}},
                    {value:vm.online.v2, name:'备用',itemStyle:{normal:{color:'rgb(59, 150, 73)'}}},
                    {value:vm.online.v3, name:'试模',itemStyle:{normal:{color:'rgb(30, 116, 199)'}}},
                    {value:vm.online.v4, name:'维护',itemStyle:{normal:{color:'rgb(243, 186, 48)'}}},
                    {value:vm.online.v5, name:'维修',itemStyle:{normal:{color:'rgb(243, 186, 48)'}}},
                    {value:vm.online.v6, name:'封存',itemStyle:{normal:{color:'rgb(242, 9, 30)'}}},
                    {value:vm.online.v7, name:'外借',itemStyle:{normal:{color:'rgb(242, 9, 30)'}}},
                    {value:vm.online.v8, name:'待维护',itemStyle:{normal:{color:'rgb(243, 186, 48)'}}},
                    {value:vm.online.v9, name:'委外维护',itemStyle:{normal:{color:'rgb(243, 186, 48)'}}}
                ]
            }
        ]
    };
    ;
    if (option && typeof option === "object") {
        myChart.setOption(option, true);
    }
});